package com.jt.www.common.controller;

import com.jt.www.common.service.HeaderConfigureService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "保单列表根据产品配置列", tags = {"HEADER-CONFIGURE-API"}, description = "保单列表根据产品配置列")
@RestController
@RequestMapping(value = "/headerConfigure")
public class HeaderConfigureController {

    public static final Logger log = LoggerFactory.getLogger(HeaderConfigureController.class);

    @Autowired
    private HeaderConfigureService headerConfigureService;

    /**
     * 根据产品编码查询列标题
     */
    @ApiOperation(value = "根据产品编码查询列标题", notes = "根据产品编码查询列标题", httpMethod = "GET")
    @GetMapping(value = "/selectHeaderByProductCode", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseEntity selectHeaderByProductCode(@ApiParam(value = "产品编码", required = false) @RequestParam(value = "productCode") String productCode,
                                                    @ApiParam(value = "标识:1-投保单;2-批单;", required = true) @RequestParam(value = "identiFication") String identiFication) throws Exception {

        ResponseEntity resultMap = headerConfigureService.selectHeaderByProductCode(productCode, identiFication);
        return resultMap;
    }
}
